package com.example.demo.app.service.impl;

import com.example.demo.app.repository.StudentRepository;
import com.example.demo.app.service.StudentService;
import com.example.demo.domain.entity.Student;
import com.example.demo.domain.vo.StudentCourseGradesVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentRepository studentRepository;

    @Override
    public Student queryStudentById(Integer id) {
        return studentRepository.queryStudentById(id);
    }

    @Override
    public List<Student> queryStudentList() {
        return studentRepository.queryStudentList();
    }

    @Override
    public Integer addStudent(Student student) {
        return studentRepository.addStudent(student);
    }

    @Override
    public Integer saveStudent(Student student) {
        return studentRepository.saveStudent(student);
    }

    @Override
    public Integer deleteStudentById(Integer id) {
        return studentRepository.deleteStudentById(id);
    }

    @Override
    public List<StudentCourseGradesVO> queryStudentCourseGrade(String sname) {
        return studentRepository.queryStudentCourseGrade(sname);
    }
}
